'''
Created on Jul 5, 2014

@author: Leon
'''

def addRightSideToList(l):
    '''
    doesn't work because order matters
    '''
    toAdd = []
    for item in l:
        if 'LT_' in item:
            toAdd.append(item.replace('LT_', 'RT_'))
    return l + toAdd

# to switch off an action,
# just add '-' or something so it won't run
build_actions = ['-bind',
                 '-sec_motion_system',
                 '-primary_ctl_system_first',
                 'primary_ctl_system_second',
                 '-load_weights',
                 '-clean',
                 '-eyes',
                 '-eyeballs']

# list of priCtls for first pass
# order is important
# those created earlier can be affected by those created later
# only need to specify LT and CT - RT is added in all_bnds_for_priCtls

bnds_for_priCtls = [u'LT_upper_eyelid_pLoc',
                    u'LT_lower_eyelid_pLoc',
                    u'LT__eyeMover_pLoc',
                    u'CT__noseTip_pLoc',
                    u'CT__noseMover_pLoc',
                    u'LT__browCrease_pLoc',
                    u'LT_mid_browA_pLoc',
                    u'LT_out_browB_pLoc',
                    u'LT__browMover_pLoc',
                    u'LT_mid_cheek_pLoc',
                    u'LT__squint_pLoc',
                    u'LT_upperSneer_lip_pLoc',
                    u'LT_lowerSneer_lip_pLoc',
                    u'CT_upper_lip_pLoc',
                    u'CT_lower_lip_pLoc',
                    u'LT_corner_lip_pLoc',
                    u'CT__mouthMover_pLoc',
                    u'CT__jaw_pLoc']

all_bnds_for_priCtls = addRightSideToList(bnds_for_priCtls)

# format to save priCtlMappings
# {priCtl: {bnd: weight,
#             bnd: weight,
#             bnd: weight}}

priCtlMappings = {u'CT__jaw_pri_ctrl': {u'CT__chin_bnd': 1.0,
                       u'CT__jaw_bnd': 1.0,
                       u'CT__neck_bnd': 0.8,
                       u'CT_lower_lip_bnd': 1.0,
                       u'CT_mid_chin_bnd': 1.0,
                       u'CT_upper_lip_bnd': 0.01,
                       u'LT__chin_bnd': 1.0,
                       u'LT__neck_bnd': 0.8,
                       u'LT__sneer_bnd': 0.1,
                       u'LT_corner_jaw_bnd': 0.8,
                       u'LT_corner_lip_bnd': 0.5,
                       u'LT_low_cheek_bnd': 0.5,
                       u'LT_low_crease_bnd': 0.5,
                       u'LT_low_jaw_bnd': 1.0,
                       u'LT_lowerPinch_lip_bnd': 0.65,
                       u'LT_lowerSide_lip_bnd': 0.975,
                       u'LT_lowerSneer_lip_bnd': 0.85,
                       u'LT_mid_cheek_bnd': 0.5,
                       u'LT_mid_chin_bnd': 0.95,
                       u'LT_mid_crease_bnd': 0.1,
                       u'LT_upperPinch_lip_bnd': 0.35,
                       u'LT_upperSide_lip_bnd': 0.035,
                       u'LT_upperSneer_lip_bnd': 0.15,
                       u'RT__chin_bnd': 1.0,
                       u'RT__neck_bnd': 0.8,
                       u'RT__sneer_bnd': 0.1,
                       u'RT_corner_jaw_bnd': 0.8,
                       u'RT_corner_lip_bnd': 0.5,
                       u'RT_low_cheek_bnd': 0.5,
                       u'RT_low_crease_bnd': 0.5,
                       u'RT_low_jaw_bnd': 1.0,
                       u'RT_lowerPinch_lip_bnd': 0.65,
                       u'RT_lowerSide_lip_bnd': 0.975,
                       u'RT_lowerSneer_lip_bnd': 0.85,
                       u'RT_mid_cheek_bnd': 0.5,
                       u'RT_mid_chin_bnd': 0.95,
                       u'RT_mid_crease_bnd': 0.1,
                       u'RT_upperPinch_lip_bnd': 0.35,
                       u'RT_upperSide_lip_bnd': 0.035,
                       u'RT_upperSneer_lip_bnd': 0.15},
 u'CT__mouthMover_pri_ctrl': {u'CT__mouthMover_bnd': 1.0,
                              u'CT_lower_lip_bnd': 1.0,
                              u'CT_mid_chin_bnd': 0.5,
                              u'CT_upper_lip_bnd': 1.0,
                              u'LT__philtrum_bnd': 0.05,
                              u'LT__sneer_bnd': 0.35,
                              u'LT_corner_lip_bnd': 1.0,
                              u'LT_in_philtrum_bnd': 0.05,
                              u'LT_low_crease_bnd': 0.5,
                              u'LT_lowerPinch_lip_bnd': 1.0,
                              u'LT_lowerSide_lip_bnd': 1.0,
                              u'LT_lowerSneer_lip_bnd': 1.0,
                              u'LT_mid_cheek_bnd': 0.25,
                              u'LT_mid_chin_bnd': 0.5,
                              u'LT_mid_crease_bnd': 0.3,
                              u'LT_upperPinch_lip_bnd': 1.0,
                              u'LT_upperSide_lip_bnd': 1.0,
                              u'LT_upperSneer_lip_bnd': 1.0,
                              u'RT__philtrum_bnd': 0.05,
                              u'RT__sneer_bnd': 0.35,
                              u'RT_corner_lip_bnd': 1.0,
                              u'RT_in_philtrum_bnd': 0.05,
                              u'RT_low_crease_bnd': 0.5,
                              u'RT_lowerPinch_lip_bnd': 1.0,
                              u'RT_lowerSide_lip_bnd': 1.0,
                              u'RT_lowerSneer_lip_bnd': 1.0,
                              u'RT_mid_cheek_bnd': 0.25,
                              u'RT_mid_chin_bnd': 0.5,
                              u'RT_mid_crease_bnd': 0.3,
                              u'RT_upperPinch_lip_bnd': 1.0,
                              u'RT_upperSide_lip_bnd': 1.0,
                              u'RT_upperSneer_lip_bnd': 1.0},
 u'CT__noseMover_pri_ctrl': {u'CT__noseMover_bnd': 1.0,
                             u'CT__noseTip_bnd': 1.0,
                             u'LT__nostril_bnd': 1.0,
                             u'RT__nostril_bnd': 1.0},
 u'CT__noseTip_pri_ctrl': {u'CT__noseTip_bnd': 1.0,
                           u'LT__nostril_bnd': 1.0,
                           u'RT__nostril_bnd': 1.0},
 u'CT_lower_lip_pri_ctrl': {u'CT_lower_lip_bnd': 1.0,
                            u'CT_mid_chin_bnd': 0.25,
                            u'LT_lowerPinch_lip_bnd': 0.1,
                            u'LT_lowerSide_lip_bnd': 0.9,
                            u'LT_lowerSneer_lip_bnd': 0.5,
                            u'RT_lowerPinch_lip_bnd': 0.1,
                            u'RT_lowerSide_lip_bnd': 0.9,
                            u'RT_lowerSneer_lip_bnd': 0.5},
 u'CT_upper_lip_pri_ctrl': {u'CT_upper_lip_bnd': 1.0,
                            u'LT_upperPinch_lip_bnd': 0.1,
                            u'LT_upperSide_lip_bnd': 0.85,
                            u'LT_upperSneer_lip_bnd': 0.5,
                            u'RT_upperPinch_lip_bnd': 0.1,
                            u'RT_upperSide_lip_bnd': 0.85,
                            u'RT_upperSneer_lip_bnd': 0.5},
 u'LT__browMover_pri_ctrl': {u'CT__brow_bnd': 0.25,
                             u'LT__browCrease_bnd': 0.5,
                             u'LT_in_brow_bnd': 0.5,
                             u'LT__browMover_bnd': 1.0,
                             u'LT_in_browA_bnd': 0.8,
                             u'LT_in_browB_bnd': 0.95,
                             u'LT_mid_browA_bnd': 1.0,
                             u'LT_mid_browB_bnd': 0.9,
                             u'LT_out_browA_bnd': 0.7,
                             u'LT_out_browB_bnd': 0.4},
 u'LT__eyeMover_pri_ctrl': {u'LT__eyeMover_bnd': 1.0,
                            u'LT_inCorner_eyeSocket_bnd': 1.0,
                            u'LT_in_cheek_bnd': 1.0,
                            u'LT_in_eyeSocket_bnd': 1.0,
                            u'LT_innerLower_eyelid_bnd': 1.0,
                            u'LT_innerUpper_eyelid_bnd': 1.0,
                            u'LT_inner_eyelid_bnd': 1.0,
                            u'LT_lower_eyelid_bnd': 1.0,
                            u'LT_mid_eyeSocket_bnd': 1.0,
                            u'LT_outCorner_eyeSocket_bnd': 1.0,
                            u'LT_out_cheek_bnd': 1.0,
                            u'LT_out_eyeSocket_bnd': 1.0,
                            u'LT_outerLower_eyelid_bnd': 1.0,
                            u'LT_outerUpper_eyelid_bnd': 1.0,
                            u'LT_outer_eyelid_bnd': 1.0,
                            u'LT_up_cheek_bnd': 1.0,
                            u'LT_upper_eyelid_bnd': 1.0},
 u'LT__squint_pri_ctrl': {u'LT__squint_bnd': 1.0,
                          u'LT_in_cheek_bnd': 0.25,
                          u'LT_outCorner_eyeSocket_bnd': 0.15,
                          u'LT_out_cheek_bnd': 0.85,
                          u'LT_up_cheek_bnd': 0.45},
 u'LT_corner_lip_pri_ctrl': {u'CT_lower_lip_bnd': 0.05,
                             u'CT_upper_lip_bnd': 0.05,
                             u'LT__sneer_bnd': 0.4,
                             u'LT_corner_lip_bnd': 1.0,
                             u'LT_low_crease_bnd': 0.5,
                             u'LT_lowerPinch_lip_bnd': 0.98,
                             u'LT_lowerSide_lip_bnd': 0.35,
                             u'LT_lowerSneer_lip_bnd': 0.75,
                             u'LT_mid_chin_bnd': 0.5,
                             u'LT_mid_crease_bnd': 0.3,
                             u'LT_upperPinch_lip_bnd': 0.98,
                             u'LT_upperSide_lip_bnd': 0.35,
                             u'LT_upperSneer_lip_bnd': 0.75},
 u'LT_in_brow_pri_ctrl': {u'CT__brow_bnd': 0.5,
                           u'LT__browCrease_bnd': 1.0,
                           u'LT_in_brow_bnd': 1.0,
                           u'LT_in_browA_bnd': 1.0,
                           u'LT_in_browB_bnd': 0.65,
                           u'LT_mid_browA_bnd': 0.25},
 u'LT_lowerSneer_lip_pri_ctrl': {u'CT_lower_lip_bnd': 0.5,
                                 u'LT_lowerPinch_lip_bnd': 0.25,
                                 u'LT_lowerSide_lip_bnd': 0.9,
                                 u'LT_lowerSneer_lip_bnd': 1.0,
                                 u'RT_lowerSide_lip_bnd': 0.1},
 u'LT_lower_eyelid_pri_ctrl': {u'LT_innerLower_eyelid_bnd': 0.1,
                               u'LT_inner_eyelid_bnd': 0.1,
                               u'LT_lower_eyelid_bnd': 0.1,
                               u'LT_outerLower_eyelid_bnd': 0.1,
                               u'LT_outer_eyelid_bnd': 0.1},
 u'LT_mid_browA_pri_ctrl': {u'LT_in_browA_bnd': 0.4,
                            u'LT_in_browB_bnd': 0.8,
                            u'LT_mid_browA_bnd': 1.0,
                            u'LT_mid_browB_bnd': 0.8,
                            u'LT_out_browA_bnd': 0.4},
 u'LT_mid_cheek_pri_ctrl': {u'LT_corner_lip_bnd': 0.3,
                            u'LT_low_crease_bnd': 0.6,
                            u'LT_low_jaw_bnd': 0.2,
                            u'LT_lowerPinch_lip_bnd': 0.3,
                            u'LT_lowerSneer_lip_bnd': 0.1,
                            u'LT_mid_cheek_bnd': 1.0,
                            u'LT_upperPinch_lip_bnd': 0.3,
                            u'LT_upperSneer_lip_bnd': 0.1},
 u'LT_out_browB_pri_ctrl': {u'LT_mid_browA_bnd': 0.2,
                            u'LT_mid_browB_bnd': 0.4,
                            u'LT_out_browA_bnd': 0.75,
                            u'LT_out_browB_bnd': 1.0},
 u'LT_upperSneer_lip_pri_ctrl': {u'CT_upper_lip_bnd': 0.5,
                                 u'LT_upperPinch_lip_bnd': 0.25,
                                 u'LT_upperSide_lip_bnd': 0.9,
                                 u'LT_upperSneer_lip_bnd': 1.0,
                                 u'RT_upperSide_lip_bnd': 0.05},
 u'LT_upper_eyelid_pri_ctrl': {u'LT_innerUpper_eyelid_bnd': 0.1,
                               u'LT_inner_eyelid_bnd': 0.1,
                               u'LT_outerUpper_eyelid_bnd': 0.1,
                               u'LT_outer_eyelid_bnd': 0.1,
                               u'LT_upper_eyelid_bnd': 0.1},
 u'RT__browMover_pri_ctrl': {u'CT__brow_bnd': 0.25,
                             u'RT__browCrease_bnd': 0.5,
                             u'RT_in_brow_bnd': 0.5,
                             u'RT__browMover_bnd': 1.0,
                             u'RT_in_browA_bnd': 0.8,
                             u'RT_in_browB_bnd': 0.95,
                             u'RT_mid_browA_bnd': 1.0,
                             u'RT_mid_browB_bnd': 0.9,
                             u'RT_out_browA_bnd': 0.7,
                             u'RT_out_browB_bnd': 0.4},
 u'RT__eyeMover_pri_ctrl': {u'RT__eyeMover_bnd': 1.0,
                            u'RT_inCorner_eyeSocket_bnd': 1.0,
                            u'RT_in_cheek_bnd': 1.0,
                            u'RT_in_eyeSocket_bnd': 1.0,
                            u'RT_innerLower_eyelid_bnd': 1.0,
                            u'RT_innerUpper_eyelid_bnd': 1.0,
                            u'RT_inner_eyelid_bnd': 1.0,
                            u'RT_lower_eyelid_bnd': 1.0,
                            u'RT_mid_eyeSocket_bnd': 1.0,
                            u'RT_outCorner_eyeSocket_bnd': 1.0,
                            u'RT_out_cheek_bnd': 1.0,
                            u'RT_out_eyeSocket_bnd': 1.0,
                            u'RT_outerLower_eyelid_bnd': 1.0,
                            u'RT_outerUpper_eyelid_bnd': 1.0,
                            u'RT_outer_eyelid_bnd': 1.0,
                            u'RT_up_cheek_bnd': 1.0,
                            u'RT_upper_eyelid_bnd': 1.0},
 u'RT__squint_pri_ctrl': {u'RT__squint_bnd': 1.0,
                          u'RT_in_cheek_bnd': 0.25,
                          u'RT_outCorner_eyeSocket_bnd': 0.15,
                          u'RT_out_cheek_bnd': 0.85,
                          u'RT_up_cheek_bnd': 0.45},
 u'RT_corner_lip_pri_ctrl': {u'CT_lower_lip_bnd': 0.05,
                             u'CT_upper_lip_bnd': 0.05,
                             u'RT__sneer_bnd': 0.4,
                             u'RT_corner_lip_bnd': 1.0,
                             u'RT_low_crease_bnd': 0.5,
                             u'RT_lowerPinch_lip_bnd': 0.98,
                             u'RT_lowerSide_lip_bnd': 0.35,
                             u'RT_lowerSneer_lip_bnd': 0.75,
                             u'RT_mid_chin_bnd': 0.5,
                             u'RT_mid_crease_bnd': 0.3,
                             u'RT_upperPinch_lip_bnd': 0.98,
                             u'RT_upperSide_lip_bnd': 0.35,
                             u'RT_upperSneer_lip_bnd': 0.75},
 u'RT_in_brow_pri_ctrl': {u'CT__brow_bnd': 0.5,
                           u'RT__browCrease_bnd': 1.0,
                           u'RT_in_brow_bnd': 1.0,
                           u'RT_in_browA_bnd': 1.0,
                           u'RT_in_browB_bnd': 0.65,
                           u'RT_mid_browA_bnd': 0.25},
 u'RT_lowerSneer_lip_pri_ctrl': {u'CT_lower_lip_bnd': 0.5,
                                 u'RT_lowerPinch_lip_bnd': 0.25,
                                 u'RT_lowerSide_lip_bnd': 0.9,
                                 u'RT_lowerSneer_lip_bnd': 1.0},
 u'RT_lower_eyelid_pri_ctrl': {u'RT_innerLower_eyelid_bnd': 0.1,
                               u'RT_inner_eyelid_bnd': 0.1,
                               u'RT_lower_eyelid_bnd': 0.1,
                               u'RT_outerLower_eyelid_bnd': 0.1,
                               u'RT_outer_eyelid_bnd': 0.1},
 u'RT_mid_browA_pri_ctrl': {u'RT_in_browA_bnd': 0.4,
                            u'RT_in_browB_bnd': 0.8,
                            u'RT_mid_browA_bnd': 1.0,
                            u'RT_mid_browB_bnd': 0.8,
                            u'RT_out_browA_bnd': 0.4},
 u'RT_mid_cheek_pri_ctrl': {u'RT_corner_lip_bnd': 0.3,
                            u'RT_low_crease_bnd': 0.6,
                            u'RT_low_jaw_bnd': 0.2,
                            u'RT_lowerPinch_lip_bnd': 0.3,
                            u'RT_lowerSneer_lip_bnd': 0.1,
                            u'RT_mid_cheek_bnd': 1.0,
                            u'RT_upperPinch_lip_bnd': 0.3,
                            u'RT_upperSneer_lip_bnd': 0.1},
 u'RT_out_browB_pri_ctrl': {u'RT_mid_browA_bnd': 0.2,
                            u'RT_mid_browB_bnd': 0.4,
                            u'RT_out_browA_bnd': 0.75,
                            u'RT_out_browB_bnd': 1.0},
 u'RT_upperSneer_lip_pri_ctrl': {u'CT_upper_lip_bnd': 0.5,
                                 u'RT_upperPinch_lip_bnd': 0.25,
                                 u'RT_upperSide_lip_bnd': 0.9,
                                 u'RT_upperSneer_lip_bnd': 1.0},
 u'RT_upper_eyelid_pri_ctrl': {u'RT_innerUpper_eyelid_bnd': 0.1,
                               u'RT_inner_eyelid_bnd': 0.1,
                               u'RT_outerUpper_eyelid_bnd': 0.1,
                               u'RT_outer_eyelid_bnd': 0.1,
                               u'RT_upper_eyelid_bnd': 0.1}}